import request from '@/utils/request'

// 根据产品品号插入多条工序信息
export function addProcess(params) {
  return request({
    params,
    url: '/back/processJobClass/addProcess',
    method: 'post'
  })
}

// 获取工艺路线列表
export function getProcessList(params) {
  return request({
    params,
    url: '/back/processJobClass/processPage',
    method: 'post'
  })
}

// 工单获取工艺路线列表
export function ptsCodesList(params,data) {
  return request({
    params,
    data,
    url: '/device/pts/ptsCode',
    method: 'post'
  })
}

// 修改工序职级信息
// 修改工位绑定的部门和职位等级
export function changeProcessRank(params) {
  return request({
    params,
    url: '/back/processJobClass/upDateProcess',
    method: 'post'
  })
}

// 工艺经理权限可以修改审核是否通过
export function upIsDelete(params) {
  return request({
    params,
    url: '/back/processJobClass/upIsDelete',
    method: 'post'
  })
}

// 删除工序
export function delProcess(params) {
  return request({
    params,
    url: '/back/processJobClass/delProcess',
    method: 'post'
  })
}

// 获取器件规格，pts提供
export function getPtsCode(params) {
  return request({
    params,
    url: `/device/pts/ptsCode`,
    method: 'post'
  })
}

// 获取器件规格，mes提供
export function getptsCodes(params) {
  return request({
    params,
    url: `/device/pts/ptsCodes`,
    method: 'post'
  })
}

// 获取器件规格
export function findProcess(params) {
  return request({
    params,
    url: `/back/processJobClass/findProcess`,
    method: 'post'
  })
}
// 提交
export function saveProcessJobClassCodeEms(data) {
  return request({
    data,
    url: `/back/processJobClass/saveProcessJobClassCodeEms`,
    method: 'post'
  })
}
// 添加栈板
export function savePalletCount(data) {
  return request({
    data,
    url: `/back/processJobClass/savePalletCount`,
    method: 'post'
  })
}

// 无栈板
export function delPalletCodeProcessEms(data) {
  return request({
    data,
    url: `/back/processJobClass/delPalletCodeProcessEms`,
    method: 'post'
  })
}
// 删除条码
export function delProcessJobClassCodeEms(type,data) {
  return request({
    data,
    url: `/back/processJobClass/delProcessJobClassCodeEms?type=${type}`,
    method: 'post'
  })
}
// 条码配置结果查询
export function findProcessJobClassCodeEms(data) {
  return request({
    data,
    url: `/sop/findProcessJobClassCodeEms`,
    method: 'post'
  })
}

// ems车间条码结果查询
export function finDeviceBarcodeEms(data) {
  return request({
    data,
    url: `/back/processJobClass/finDeviceBarcodeEms`,
    method: 'post'
  })
}
// ems车间条码结果查询----删除机柜下所有器件
export function delDeviceBarcodeEms(data) {
  return request({
    data,
    url: `/back/processJobClass/delDeviceBarcodeEms`,
    method: 'post'
  })
}
// ems车间条码结果查询----删除栈板条码
export function delPalletCodeEms(data) {
  return request({
    data,
    url: `/back/processJobClass/delPalletCodeEms`,
    method: 'post'
  })
}
// ems车间条码结果查询----删除器件条码
export function delDeviceCodeEms(data) {
  return request({
    data,
    url: `/back/processJobClass/delDeviceCodeEms`,
    method: 'post'
  })
}
// ems查询，3.11:8001
// export function GetEntityRevision(data) {
//     return request({
//         params: data,
//         url: `/hw/GetEntityRevision`,
//         method: 'post'
//     })
// }
// ems查询,8110
export function GetEntityRevision(data) {
  return request({
    params: data,
    url: `/back/processJobClass/GetEntityRevision`,
    method: 'post'
  })
}

// 条码过站记录查询
export function findDeviceBarcodeCode(data) {
  return request({
    params: data,
    url: `/device/findDeviceBarcodeCode`,
    method: 'post'
  })
}
// 查询创建的临技
export function findLinJi(data) {
  return request({
    params: data,
    url: `/device/findLinJi`,
    method: 'post'
  })
}
// 工艺指定那个工序需要临技校验
export function saveLinJiPro(data) {
  return request({
    params: data,
    url: `/device/saveLinJiPro`,
    method: 'post'
  })
}

// 产品获取工艺信息
export function getProcessByProduceNo(data) {
  return request({
    params: data,
    url: `/back/processJobClass/getProcessByProduceNo`,
    method: 'post'
  })
}

// 获取产品信息
export function getMaterial(data) {
  return request({
    params: data,
    url: `/sop/getMaterial`,
    method: 'post'
  })
}

// 获取产品BOM
export function getMaterialBom(data) {
  return request({
    params: data,
    url: `/sop/getMaterialBom`,
    method: 'post'
  })
}

// 获取工具和检具
export function getEmsFacility(data) {
  return request({
    params: data,
    url: `/ems-facility/getEmsFacility`,
    method: 'post'
  })
}

// 保存SOP首页
export function saveSop(data) {
  return request({
    url: `/sopItem/saveSop`,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// SOP提交审核
export function submitReview(data) {
  return request({
    url: `/sopItem/submitReview`,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// SOP明细获取
export function getSopItem(data) {
  return request({
    url: `/sopItem/getSopItem`,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// 保存SOP明显草稿
export function saveSopItemDraft(data) {
  return request({
    url: `/sopItem/saveSopItemDraft`,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// 删除SOP明细页
export function removeSopItemPage(data) {
  return request({
    url: `/sopItem/removeSopItemPage`,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// SOP查询
export function sopQueryPage(data) {
  return request({
    url: `/sopItem/sopQueryPage`,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// SOP状态处理
export function sopHandle(data) {
  return request({
    url: `/sopItem/sopHandle`,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// SOP明细BOM数量校验
export function checkBomQty(data) {
  return request({
    url: `/sopItem/checkBomQty`,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// 获取产品SOP记录
export function getProduceNoSopList(data) {
  return request({
    url: `/sopItem/getProduceNoSopList`,
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// 下载产品物料清单
export function getSopMaterials(params) {
  return request({
    url: `/sopItem/getSopMaterials/${params}`,
    method: 'get',
    responseType: 'blob'
  })
}

// 下载产品SOP
export function exportSopPdf(params) {
  return request({
    url: `/sopItem/exportSopPdf/${params}`,
    method: 'get',
    responseType: 'blob'
  })
}

// 开料
export function findRoughShapeCutting(data) {
  return request({
    params: data,
    url: `/device/NumericalControl/findRoughShapeCutting`,
    method: 'post'
  })
}

// 工时数据
export function findMainPartNumberTime(data) {
  return request({
    params: data,
    url: `/back/processJobClass/findMainPartNumberTime`,
    method: 'post'
  })
}

// 查询工序编号
export function findsel(data) {
  return request({
    params: data,
    url: `/back/process-job-no/sel`,
    method: 'post'
  })
}
// 新增工序编号
export function findins(data) {
  return request({
    data,
    url: `/back/process-job-no/ins`,
    method: 'post'
  })
}
// 更新工序编号
export function findupd(data) {
  return request({
    data,
    url: `/back/process-job-no/upd`,
    method: 'post'
  })
}
// 删除工序编号
export function finddel(data) {
  return request({
    data,
    url: `/back/process-job-no/del`,
    method: 'post'
  })
}

// 工序代码的分组，能查到所有的工序代码
export function groupProcessNo(data) {
  return request({
    data,
    url: `/back/process-job-no/groupProcessNo`,
    method: 'post'
  })
}

// 新增对应品号的工序
export function addTechnologyNoProcess(data) {
  return request({
    data,
    url: `/back/processJobClass/addTechnologyNoProcess`,
    method: 'post'
  })
}

// 获取所有工序大类
export function findProcessTypeGroup(data) {
  return request({
    data,
    url: `/back/money-config/findProcessTypeGroup`,
    method: 'post'
  })
}
// 获取计件方案维护数据
export function findMoneyConfig(data) {
  return request({
    data,
    url: `/back/money-config/find`,
    method: 'post'
  })
}

// 删除一个计件方案的一个条件
export function delMoneyConfig(data) {
  return request({
    data,
    url: `/back/money-config/del`,
    method: 'post'
  })
}

// 保存
export function saveMoneyConfig(data) {
  return request({
    data,
    url: `/back/money-config/save`,
    method: 'post'
  })
}
// /检验公式或比较值是否正确如果正确，公式对的会返回对应的计算值，对比值对的会返回true
export function verifyEquation(data) {
  return request({
    data,
    url: `/back/money-config/verifyEquation`,
    method: 'post'
  })
}

// 查询工资计算公式
export function selFormulag(data) {
  return request({
    data,
    url: `/back/money-formula/sel`,
    method: 'post'
  })
}

// 保存工资计算公式
export function saveFormulag(data) {
  return request({
    data,
    url: `/back/money-formula/save`,
    method: 'post'
  })
}

// 编辑工资计算公式
export function updFormulag(data) {
  return request({
    data,
    url: `/back/money-formula/upd`,
    method: 'post'
  })
}

// 删除工资计算公式
export function delFormulag(data) {
  return request({
    data,
    url: `/back/money-formula/del`,
    method: 'post'
  })
}

// 板材维护
// 新增
// 新增板材信息
export function saveplate(data) {
  return request({
    data,
    url: `/back/money-util-texture/save`,
    method: 'post'
  })
}
// 查询板材信息
export function seldplate(data) {
  return request({
    data,
    url: `/back/money-util-texture/sel`,
    method: 'post'
  })
}
// 打印板材信息
export function printlate(data) {
  return request({
    data,
    url: `ems-facility/print`,
    method: 'post'
  })
}
// 修改板材信息
export function updplate(data) {
  return request({
    data,
    url: `/back/money-util-texture/upd`,
    method: 'post'
  })
}
// 删除板材
export function delplate(data) {
  return request({
    data,
    url: `/back/money-util-texture/del`,
    method: 'post'
  })
}

// 工装注册，新增
export function addfacility(data) {
  return request({
    data,
    url: `/ems-facility/add`,
    method: 'post'
  })
}

// 工装注册，查询
export function selfacility(data) {
  return request({
    data,
    url: `/ems-facility/sel`,
    method: 'post'
  })
}

// 工装注册，修改
export function updfacility(params) {
  return request({
    params,
    url: `/ems-facility/upd`,
    method: 'post'
  })
}

// 工装注册，删除
export function delfacility(data) {
  return request({
    data,
    url: `/ems-facility/del`,
    method: 'post'
  })
}

// 工装工序配置，新增
export function addprocessorder(data) {
  return request({
    data,
    url: `/back/ems-facility-technology-no-process-order/add`,
    method: 'post'
  })
}

// 工装工序配置，查询
export function selprocessorder(data) {
  return request({
    data,
    url: `/back/ems-facility-technology-no-process-order/sel`,
    method: 'post'
  })
}

// 工装工序配置，修改
export function updprocessorder(data) {
  return request({
    data,
    url: `/back/ems-facility-technology-no-process-order/upd`,
    method: 'post'
  })
}

// 工装工序配置，删除
export function delprocessorder(data) {
  return request({
    data,
    url: `/back/ems-facility-technology-no-process-order/del`,
    method: 'post'
  })
}

// 工装对应的类型名称，查询
export function selbarcodeType(data) {
  return request({
    data,
    url: `/back/ems-facility-barcode-type/sel`,
    method: 'post'
  })
}

// 设备校验管理 点击修改回填信息
export function facilityVerifTest(data) {
  return request({
    data,
    url: `/ems-facility-verif-test/selFacilityBarcodeLase`,
    method: 'post'
  })
}

// 工装对应的类型名称，删除
export function delbarcodeType(data) {
  return request({
    data,
    url: `/back/ems-facility-barcode-type/del`,
    method: 'post'
  })
}

// 工装对应的类型名称，修改
export function updbarcodeType(data) {
  return request({
    data,
    url: `/back/ems-facility-barcode-type/upd`,
    method: 'post'
  })
}

// 工装对应的类型名称，新增
export function addbarcodeType(data) {
  return request({
    data,
    url: `/back/ems-facility-barcode-type/add`,
    method: 'post'
  })
}

// 工装点检与维修保养，查询
export function selmomentTest(data) {
  return request({
    data,
    url: `/back/ems-facility-moment-test/sel`,
    method: 'post'
  })
}

// 工装点检与维修保养，删除
export function delmomentTest(data) {
  return request({
    data,
    url: `/back/ems-facility-moment-test/del`,
    method: 'post'
  })
}

// 工装点检与维修保养，新增
export function addmomentTest(data) {
  return request({
    data,
    url: `/back/ems-facility-moment-test/add`,
    method: 'post'
  })
}

// 工装出入库，查询
export function selfacilityAccess(data) {
  return request({
    data,
    url: `/ems-facility-access/sel`,
    method: 'post'
  })
}
// 工装出入库，删除
export function delfacilityAccess(params) {
  return request({
    params,
    url: `/ems-facility-access/del`,
    method: 'post'
  })
}
// 工装出入库，修改
export function updfacilityAccess(params) {
  return request({
    params,
    url: `/ems-facility-access/upd`,
    method: 'post'
  })
}
// 工装出入库，新增
export function addfacilityAccess(params) {
  return request({
    params,
    url: `/ems-facility-access/add`,
    method: 'post'
  })
}
// stp品号添加铭牌
export function savePackingMaterialsCodeCount(params) {
  return request({
    params,
    url: `/back/processJobClass/savePackingMaterialsCodeCount`,
    method: 'post'
  })
}

// 按照工单品号获取底下物料编码
export function processJobClassFind(params) {
  return request({
    params,
    url: `/back/processJobClass/findElementCoding`,
    method: 'post'
  })
}

// 按照工单品号获取底下中文描述
export function findChineseDescription(params) {
  return request({
    params,
    url: `/back/processJobClass/findChineseDescription`,
    method: 'post'
  })
}


// 用品号查物料编码列表
export function moneyConfigFind(params) {
  return request({
    params,
    url: `/back/process-job-class-money-config/find`,
    method: 'post'
  })
}

// 用品号查物料编码列表提交
export function moneyConfigUpd(params) {
  return request({
    params,
    url: `/back/process-job-class-money-config/upd`,
    method: 'post'
  })
}

// 料编码列表删除
export function moneyConfigDel(params) {
  return request({
    params,
    url: `/back/process-job-class-money-config/del`,
    method: 'post'
  })
}

// 叫料
export function saveWorkshopCallTime(params) {
  return request({
    params,
    url: `/device/saveWorkshopCallTime`,
    method: 'post'
  })
}

// 叫料
export function sopScanIf(params) {
  return request({
    params,
    url: `/back/processJobClass/sopScanIf`,
    method: 'post'
  })
}

// ems工时总包查询
export function turnkeyProject(params) {
  return request({
    params,
    url: `/process-job-class-time-turnkey-project/find`,
    method: 'post'
  })
}

// ems工时总包导入
export function projectfind(params) {
  return request({
    params,
    url: `/process-job-class-time-turnkey-project/find`,
    method: 'post'
  })
}

// ems工时总包删除
export function projectdel(params) {
  return request({
    params,
    url: `/process-job-class-time-turnkey-project/del`,
    method: 'post'
  })
}

// ems工时总包新增
export function projectins(params) {
  return request({
    params,
    url: `/process-job-class-time-turnkey-project/ins`,
    method: 'post'
  })
}

// ems工时总包修改
export function projectupd(params) {
  return request({
    params,
    url: `/process-job-class-time-turnkey-project/upd`,
    method: 'post'
  })
}

// ems工时总包修改
export function AndtechnologyNoLike(params) {
  return request({
    params,
    url: `/back/processJobClass/findSpecificationAndtechnologyNoLike`,
    method: 'post'
  })
}

// 获取物料类型
export function findMaterialClassGroupBy(params) {
  return request({
    params,
    url: `/back/money-config-ems/findMaterialClassGroupBy`,
    method: 'post'
  })
}

// ems工时总包刷新
export function turnkeyProjectrefresh(params) {
  return request({
    params,
    url: `/process-job-class-time-turnkey-project/refresh`,
    method: 'post'
  })
}

// ems车间扫码物料编码长度查询
export function historyLenth(params) {
  return request({
    params,
    url: `/back/process-material-code-history-lenth/sel`,
    method: 'post'
  })
}

// ems车间扫码物料编码长度新增
export function historyLenthins(params) {
  return request({
    params,
    url: `/back/process-material-code-history-lenth/ins`,
    method: 'post'
  })
}

// ems车间扫码物料编码长度删除
export function historyLenthdel(params) {
  return request({
    params,
    url: `/back/process-material-code-history-lenth/del`,
    method: 'post'
  })
}

// 注册建档新增资源
export function facilityAdd(params) {
  return request({
    params,
    url: `/ems-facility/add`,
    method: 'post'
  })
}

// 注册建档查询
export function facilitySel(params) {
  return request({
    params,
    url: `/ems-facility/sel`,
    method: 'post'
  })
}

// 传id，使用明细
export function facilityAccess(params) {
  return request({
    params,
    url: `/ems-facility-access-scan-info/find`,
    method: 'post'
  })
}

//  检点/保养项目页面查询
export function configurationFind(params) {
  return request({
    params,
    url: `/back/ems-facility-maintenance-item-configuration/find`,
    method: 'post'
  })
}

//  检点/保养项目页面新增
export function configurationAdd(params) {
  return request({
    params,
    url: `/back/ems-facility-maintenance-item-configuration/add`,
    method: 'post'
  })
}

//  检点/保养项目页面修改
export function configurationUpd(params) {
  return request({
    params,
    url: `/back/ems-facility-maintenance-item-configuration/upd`,
    method: 'post'
  })
}


//  检点/保养项目页面删除
export function configurationDel(params) {
  return request({
    params,
    url: `/back/ems-facility-maintenance-item-configuration/del`,
    method: 'post'
  })
}

//  检点/保养配置页面查询
export function resourceFind(params) {
  return request({
    params,
    url: `/back/ems-facility-maintenance-item-resource-configuration/find`,
    method: 'post'
  })
}

//  检点/保养配置页面修改
export function resourceUpd(params) {
  return request({
    params,
    url: `/back/ems-facility-maintenance-item-resource-configuration/upd`,
    method: 'post'
  })
}

//  检点/保养配置页面删除
export function resourceDel(params) {
  return request({
    params,
    url: `/back/ems-facility-maintenance-item-resource-configuration/del`,
    method: 'post'
  })
}

//  查询配置项目
export function resourcefindInfo(params) {
  return request({
    params,
    url: `/back/ems-facility-maintenance-item-resource-configuration/findInfo`,
    method: 'post'
  })
}

//   点检/保养配置新增
export function onfigurationAdd(params) {
  return request({
    params,
    url: `/back/ems-facility-maintenance-item-resource-configuration/add`,
    method: 'post'
  })
}

//   点检、保养记录2级查询
export function maintenanceSel(params) {
  return request({
    params,
    url: `/ems-facility-maintenance/sel`,
    method: 'post'
  })
}

//   点检、保养记录删除
export function maintenanceDel(params) {
  return request({
    params,
    url: `/ems-facility-maintenance/del`,
    method: 'post'
  })
}

//   点检、保养记录修改
export function maintenanceUpd(params) {
  return request({
    params,
    url: `/ems-facility-maintenance/upd`,
    method: 'post'
  })
}

//   点检、保养记录新增
export function maintenanceAdd(params) {
  return request({
    params,
    url: `/ems-facility-maintenance/add`,
    method: 'post'
  })
}

//   点检、保养记录查询
export function maintenancefindGroup(data) {
  return request({
    data,
    url: `/ems-facility-maintenance/findGroup`,
    method: 'post'
  })
}

//   点检、保养记录打印
export function maintenanceWord03(data) {
  return request({
    data,
    url: `/ems-facility-maintenance/word03`,
    method: 'post'
  })
}

//   设备校验管理查询
export function verifTestSel(params) {
  return request({
    params,
    url: `/ems-facility-verif-test/sel`,
    method: 'post'
  })
}

//   设备校验管理删除
export function verifTestDel(params) {
  return request({
    params,
    url: `/ems-facility-verif-test/del`,
    method: 'post'
  })
}

//   设备校验管理新增
export function verifTestAdd(params) {
  return request({
    params,
    url: `/ems-facility-verif-test/add`,
    method: 'post'
  })
}

//   设备校验管理修改
export function verifTestUpd(params,data) {
  return request({
    params, 
    data, 
    url: `/ems-facility-verif-test/upd`,
    method: 'post'
  })
}

//   设备校验管理修改
export function getNextExecTime(params) {
  return request({
    params,
    url: `/ems-facility/getNextExecTime`,
    method: 'post'
  })
}

//   查询工作中心 + 类型
export function findsectionNo(params) {
  return request({
    params,
    url: `/sop/findsectionNo`,
    method: 'post'
  })
}

//  超期预警配置
export function wordLimitFind(params) {
  return request({
    params,
    url: `/back/word-exceed-the-time-limit/find`,
    method: 'post'
  })
} 

//  超期预警配置修改
export function wordLimitUpd(params) {
  return request({
    params,
    url: `/back/word-exceed-the-time-limit/upd`,
    method: 'post'
  })
} 

//  超期预警配置新增
export function wordLimitIns(params) {
  return request({
    params,
    url: `/back/word-exceed-the-time-limit/ins`,
    method: 'post'
  })
} 

//  超期预警配置删除
export function wordLimitDel(params) {
  return request({
    params,
    url: `/back/word-exceed-the-time-limit/del`,
    method: 'post'
  })
}

//  新员工扫码检查项目新增
export function inspectionIns(params) {
  return request({
    params,
    url: `/online-inspection/ins`,
    method: 'post'
  })
}

//  新员工扫码检查项目查询
export function inspectionFind(params) {
  return request({
    params,
    url: `/online-inspection/find`,
    method: 'post'
  })
}

//  新员工扫码检查项目修改
export function inspectionUpd(params) {
  return request({
    params,
    url: `/online-inspection/upd`,
    method: 'post'
  })
}

//  新员工扫码检查项目修删除
export function inspectionDel(params) {
  return request({
    params,
    url: `/online-inspection/del`,
    method: 'post'
  })
}

//  操作日志查询
export function operationLog(params) {
  return request({
    params,
    url: `/operationLog/find`,
    method: 'post'
  })
}

//  获取产品品号
export function screwTightening(data) {
  return request({
    data,
    url: `/screwTightening/getProcessByProduceNo`,
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    }
  })
} 

// 获取螺钉规格
export function listByType(params) {
  return request({
    params,
    url: '/back/ems-facility-barcode-type/listByType',
    method: 'post'
  })
}

// 螺钉紧固参数新增
export function screwTighteningAdd(data) {
  return request({
    data,
    url: '/screwTightening/add',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    }
  })
}

// 螺钉紧固查询
export function screwTighteningList(data) {
  return request({
    data,
    url: '/screwTightening/list',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    }
  })
} 

// 螺钉紧固修改
export function screwTighteningEdit(data) {
  return request({
    data,
    url: '/screwTightening/edit',
    method: 'post',
    headers: {
      'Content-Type': 'application/json'
    }
  })
} 